package com.soker.fan.service;

import com.soker.fan.mapper.FanMapper;
import com.soker.fan.pojo.Fan;
import com.soker.fan.pojo.FanBarrageCartitem;
import com.soker.fan.pojo.FanClass;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class FanServiceImpl implements FanService{
    @Autowired
    FanMapper fanMapper;
    //查找数量
    public int getNumber() {
        return fanMapper.getNumber();
    }
    //查找数量2
    public int getNumber2(Map map){return fanMapper.getNumber2(map);}
    //查找指定页的所有番剧
    public List<Fan> findAllFan(Map map){return fanMapper.findAllFan(map);}
    //查找指定页的所有番剧2
    public List<Fan> findAllFan2(){return fanMapper.findAllFan2();}
    //查找指定页的所有番剧3
    public List<Fan> findAllFanHu(String vname){return fanMapper.findAllFanHu(vname);}
    //追番人数(降序)
    public List<Fan> findByFansDesc(Map map){ return fanMapper.findByFansDesc(map); }
    //追番人数(升序)
    public List<Fan> findByFansAsc(Map map){return fanMapper.findByFansAsc(map);}
    //追番人数2(降序)
    public List<Fan> findByFansDesc2(Map map){ return fanMapper.findByFansDesc2(map); }
    //追番人数2(升序)
    public List<Fan> findByFansAsc2(Map map){return fanMapper.findByFansAsc2(map);}
    //最高评分(降序)
    public List<Fan> findByGradeDesc(Map map){return fanMapper.findByGradeDesc(map);}
    //最高评分(升序)
    public List<Fan> findByGradeAsc(Map map){return fanMapper.findByGradeAsc(map);}
    //最高评分2(降序)
    public List<Fan> findByGradeDesc2(Map map){ return fanMapper.findByGradeDesc2(map);}
    //最高评分2(升序)
    public List<Fan> findByGradeAsc2(Map map){return fanMapper.findByGradeAsc2(map);}
    //播放数量(降序)
    public List<Fan> findByTotalamountDesc(Map map){return fanMapper.findByTotalamountDesc(map);}
    //播放数量(升序)
    public List<Fan> findByTotalamountAsc(Map map){return fanMapper.findByTotalamountAsc(map);}
    //播放数量2(降序)
    public List<Fan> findByTotalamountDesc2(Map map){return fanMapper.findByTotalamountDesc2(map);}
    //播放数量2(升序)
    public List<Fan> findByTotalamountAsc2(Map map){return fanMapper.findByTotalamountAsc2(map);}
    //按风格查询
    public List<Fan> findByClassification(Map map){return fanMapper.findByClassification(map);}
    //查找所有番剧风格
    public List<FanClass> findAllFanClass(){return fanMapper.findAllFanClass();}
    //按番名查询
    public Fan findFanByFname(String fid){return fanMapper.findFanByFname(fid);}
    //查询某条视频是否被某用户点赞过
    public String isZanForUser(Map map){return fanMapper.isZanForUser(map);}
    //点赞
    public void updateZan(String fid){fanMapper.updateZan(fid);}
    //点赞后变为true
    public void chanIszan(Map map){fanMapper.chanIszan(map);}
    //取消点赞
    public void cancelZan(String fid){fanMapper.cancelZan(fid);}
    //取消点赞后变为false
    public void chanIszan2(Map map){fanMapper.chanIszan2(map);}
    //查询某条视频是否被某用户投币过（投币没有取消)
    public String isBiForUser(Map map){return fanMapper.isBiForUser(map);}
    //投币
    public void updateBi(String fid){fanMapper.updateBi(fid);};
    //投币后变为true
    public void chanIsbi(Map map){fanMapper.chanIsbi(map);};
    //查找对应番剧的所有评论，显示其信息
    public List<FanBarrageCartitem> findBarrageByFname(Map map){return fanMapper.findBarrageByFname(map);}
    //插入评论
    public void insertBarrage(Map map){fanMapper.insertBarrage(map);}
    //fid查找fname
    public String findFnameByFid(String fid){return fanMapper.findFnameByFid(fid);}
    //插入默认点赞记录
    public void insertDefaultZan(Map map){fanMapper.insertDefaultZan(map);}
    //查询某条视频是否被某用户追番
    public String isZhuiForUser(Map map){return fanMapper.isZhuiForUser(map);}
    //追番
    public void updateZhui(String fid){fanMapper.updateZhui(fid);}
    //追番后变为true
    public void chanIszhui(Map map){fanMapper.chanIszhui(map);}
    //取消点赞
    public void cancelZhui(String fid){fanMapper.cancelZhui(fid);}
    //取消点赞后变为false
    public void chanIszhui2(Map map){fanMapper.chanIszhui2(map);}
    //播放量+1
    public void updateTot(String fid){fanMapper.updateTot(fid);}
}
